<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<link rel="stylesheet" href="../static/css/css.css">
<script src="../static/js/jquery-1.8.3.js"></script>
<script>
    function lookCode(gsmBargainCode) {
        alert(gsmBargainCode)
    }
    function pay(gsmBargainId) {
        //生成订单并跳去订单页面
        alert("支付")
    }
</script>
<body>
<ul>
    <li>
        <a th:if="${session.user != null}">欢迎, [[${session.user.usmName}]]</a>
        <a th:if="${session.user == null}" href="http://auth.snow-mall.com?url=http://bargain.snow-mall.com/toSaveHelpRecord?gsmBargainRecordId="+[[${bre.bargainRecordId}]]>你好，请登录</a>
    </li>
    <li>
        <a th:if="${session.user == null}" href="http://auth.snow-mall.com/register.html" class="li_2">免费注册</a>
    </li>
    <li>
        <a th:if="${session.user != null}" href="http://auth.snow-mall.com/loguot.html" class="li_2">立即退出</a>
    </li>
</ul>

<a href="http://bargain.snow-mall.com">返回活动列表</a>
<table>
    <tr>
        <td>活动名称</td>
        <td>商品名称</td>
        <td>商品展示</td>
        <td>商品原价</td>
        <td>当前价格</td>
        <td>当前状态</td>
        <td>创建时间</td>
        <td>用户名</td>
        <td>操作</td>
    </tr>
    <tr th:each="li:${list.list}">
        <td th:text="${li.gsmBargainName}"></td>
        <td th:text="${li.psmName}"></td>
        <td>
            <img th:src="${li.psmImg}" alt="" style="width: 100px ; height: 100px">
        </td>
        <td th:text="${li.psmPrice}"></td>
        <td th:text="${li.gsmBargainPriceNow}"></td>
        <td th:text="${li.gsmBargainRecordStatus}"></td>
        <td th:text="${li.gsmCreateTime}"></td>
        <td th:text="${li.usmName}"></td>
        <td>
            <input type="button" th:onclick="lookCode([[${li.gsmBargainCode}]])" value="查看推广码">
            <input type="button" th:onclick="|pay(${li.gsmBargainId})|" value="支付">
        </td>
    </tr>
</table>
</body>
</html>
